package com.graduation.fq.student.Process;

import org.json.JSONObject;

/**
 * Created by jifang
 * Time 2016/5/27 21:02.
 */
public class MsgProcess extends BaseProcess{

    private String msg;

    private int uId;

    private int tId;

    public MsgProcess(String msg, int uId, int tId) {
        this.msg = msg;
        this.uId = uId;
        this.tId = tId;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }

    public int gettId() {
        return tId;
    }

    public void settId(int tId) {
        this.tId = tId;
    }

    @Override
    String getRequestUrl() {
        return String.format("/message/send.do?message=%s&u_id=%s&t_id=%s", getMsg(), getuId(), gettId());
    }

    @Override
    String getParameter() {
        return null;
    }

    @Override
    void onResult(JSONObject object) {
        setStatus(object.optInt("status"));
    }
}
